<?php

/*
 * Object/Task.php
 */

namespace Ticket\Model\Object;

class Task extends XObject {

    public $id;
    public $libelle;
    public $description;
    public $user;
    public $project;
    public $soumission;
    public $resolution;
    public $etat;
    public $priorite;
    public $ecran;
    public $remarque;

    /**
     * Remplissage des données
     * 
     * @param array $data
     */
    public function __construct($data = array()) {
        $this->exchangeArray($data);
    }

    /**
     * Remplissage des données
     * 
     * @param array $data
     */
    public function exchangeArray($data) {
        $this->id          = isset($data['id']) ? (int) $data['id'] : null;
        $this->libelle     = isset($data['libelle']) ? $data['libelle'] : '';
        $this->description = isset($data['description']) ? $data['description'] : '';
        $this->user        = isset($data['user']) ? (int) $data['user'] : 0;
        $this->project     = isset($data['project']) ? (int) $data['project'] : 0;
        $this->soumission  = isset($data['soumission']) ? $data['soumission'] : '0000-00-00';
        $this->resolution  = isset($data['resolution']) ? $data['resolution'] : '0000-00-00';
        $this->etat        = isset($data['etat']) ? (int) $data['etat'] : 0;
        $this->priorite    = isset($data['priorite']) ? (int) $data['priorite'] : 0;
        $this->ecran       = isset($data['ecran']) ? $data['ecran'] : '';
        $this->remarque    = isset($data['remarque']) ? $data['remarque'] : '';
    }

}
